//
//  AppDelegate+ZhuMu.m
//  ZhumuSDKSample
//
//  Created by 陈武琦 on 16/3/23.
//  Copyright © 2016年 SUIRUI Co., Ltd. All rights reserved. All rights reserved.
//


//测试账号: 呼叫前需要发送的请求信息
#define kAPI_KEY  @"O8czzSQBEWkq0sHDk8PixUc9FdY27"
#define kAPI_SECRET @"YgAfm0VURjiCeYgAfm0V=="
#define kLOGIN_TYPE 3 //代表email类型
#define kLOGIN_NAME @"SDKTest@zhumu.me"
#define kDISPLAY_NAME @"测试账号"


#define cwqKEmail @"598837443@qq.com"
#define cwqusername @"123456"
#define cwqusertype @"0"
#define cwqzcode @"8538036373"


#import "AppDelegate+ZhuMu.h"
#import <ZhumuSDK/ZhumuSDK.h>
#import "MainViewController.h"

@implementation WCNAppDelegate (ZhuMu)

- (void)finishLaunchingWithOptions:(NSDictionary *)launchOptions {

//    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.
    
//    CWQViewController *vc = [[CWQViewController alloc] init];
    //1. 设置ZhumuSDK的Root Navigation Controller
    //[[ZhumuSDK sharedSDK] setZhumuRootController:navController];
    //2. 启动ZhumuSDK Authorize
    [Zhumu zhumuAuthWithDelegate:self];
//    [self create];
//    [self registerUser];
}

- (void)create {

    NSDictionary *params = @{@"api_key":kAPI_KEY,
                             @"api_secret":kAPI_SECRET,
                             @"username":@"123",
                             @"email":cwqKEmail,
                             @"usertype":@0};
    NSString *url = @"https://api.zhumu.me/v1/user/create";
//    [[BRWebServiceClient sharedClient] paramDic:params];
//    [[BRWebServiceClient sharedClient] setUrl:url];
//    [[BRWebServiceClient sharedClient] postHomedataWithCompletionBlock:^(id obj, NSError *error) {
//        if(!error){
//            NSLog(@"%@",obj);
//        }else {
//            
//            NSLog(@"%@_______%@",obj,error);
//        }
//    }];



}


- (void)registerUser {

    
    NSDictionary *params = @{@"api_key":kAPI_KEY,
                             @"api_secret":kAPI_SECRET,
                             @"username":@"123456",
                             @"password":@"123456",
                             @"email":cwqKEmail,
                             @"mobile":@"13052097297"};
    NSString *url = @"https://api.zhumu.me/v1/user/regiseruser";
//    [[BRWebServiceClient sharedClient] paramDic:params];
//    [[BRWebServiceClient sharedClient] setUrl:url];
//    [[BRWebServiceClient sharedClient] postHomedataWithCompletionBlock:^(id obj, NSError *error) {
//        if(!error){
//            NSLog(@"%@",obj);
//        }else {
//            
//            NSLog(@"%@_______%@",obj,error);
//        }
//    }];
    



}


- (void)onZhumuSDKAuthReturn:(ZhumuSDKAuthError)returnValue {

    NSLog(@"%u",returnValue);


}

@end
